Random generators of vli (Very Large Integer) objects following different probability distributions.
rvlidigits(d)rvliunif(x, y)
# S3 method for default
rvliunif(x, y)
# S3 method for numeric
rvliunif(x, y)
# S3 method for vli
rvliunif(x, y)
rvlibin(n, p)
# S3 method for default
rvlibin(n, p)
# S3 method for numeric
rvlibin(n, p)
# S3 method for vli
rvlibin(n, p)
rvlinegbin(s, p)
# S3 method for default
rvlinegbin(s, p)
# S3 method for numeric
rvlinegbin(s, p)
# S3 method for vli
rvlinegbin(s, p)
rvliprime(y, iter = 10, test = "MR")
# S3 method for default
rvliprime(y, iter = 10, test = "MR")
# S3 method for numeric
rvliprime(y, iter = 10, test = "MR")
# S3 method for vli
rvliprime(y, iter = 10, test = "MR")
objects of class vli in all cases:
rvlidigits(d)
returns a object of class vli belonging to the interval [0, 10^d)
rvliunif(x, y)
returns a object of class vli belonging to the interval [x, y)
rvlibin(n, p)
returns a object of class vli belonging to the interval [0, n]
rvlinegbin(x, y)
returns a object of class vli belonging to the interval [n, Inf)
rvliprime(y, iter, test)
returns a object of class vli with the value of a prime number belonging to the interval [2, y)
number of digits of the vli class object being generated; numeric
lower bound for the object of class vli being generated; object of class vli or 32 bits integer
upper bound for the object of class vli being generated; object of class vli or 32 bits integer
number of independent Bernoulli trials; object of class vli 32 bits integer
probability of success; numeric
number of successes; vli class object or 32 bits integer
number of iterations for each number to be tested; numeric
chosen primality test: "F" for the Fermat Test, "SS" for the Solovay-Strassen Test or "MR" (by default) for the Miller-Rabin Test; character
Javier Leiva Cuadrado
The function rvlidigits(d)
returns a vli object of d
digits randomly generated following the uniform distribution. It is the most efficient way of generating random vli objects.
The function rvliunif(x, y)
returns a vli object randomly generated following the Uniform distribution with parameters x
and y
.
The function rvlibin(n, p)
returns a vli object randomly generated following the Binomial distribution with parameters n
and p
, where n
is the number of Bernoulli trials and p
the probability of success.
The function rvlinegbin(x, y)
returns a vli object randomly generated following the Negative Binomial distribution with parameters s
and p
, where s
is the number of successes and p
the probability of success.
The function rvliprime(y, iter, test)
returns a vli object randomly chosen from the set of primes up to y
.
rvlidigits(2000)
rvliunif(3425, as.vli("2061341345304562604342"))
rvlibin(100, 0.6)
rvlinegbin(as.vli("1000000"), 0.5)
rvliprime(as.vli("100000"), iter = 10, test = "MR")
Run the code above in your browser using DataLab